package com.design.pattern.builder;

import com.design.pattern.builder.director.Director;

/**
 * Created by Administrator on 2016/5/18.
 */
public class BuilderMain {
    public static void main(String[] args) {
        //1. 先构建一个欢迎消息的Builder
        WelcomMsgBuilder welcomMsgBuilder = new WelcomMsgBuilder();
        //2. 创建一个Director
        Director director = new Director(welcomMsgBuilder);
        //3. 构建
        director.construct("msg@message.com","wangxl@message.com");
        try {
            Thread.sleep(1000);
            System.out.println("你们的杂志好垃圾，我不订阅了！");
            Thread.sleep(1000);
            director = new Director(new GoodByeMsgBuilder());
            director.construct("wangxl@message.com","msg@message.com");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
